﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity.ModelConfiguration;

namespace Project_1.Models
{
    public class Follow
    {
        public string Username { get; set; }
        public int QuestionId { get; set; }
        public Follow()
        {

        }
    }

    public class FollowConfiguration : EntityTypeConfiguration<Follow>
    {
        public FollowConfiguration()
        {
            HasKey(p => new { p.Username, p.QuestionId });
            Property(p => p.Username).
                HasColumnName("Username").
                IsRequired();
            Property(p => p.QuestionId).
                HasColumnName("QuestionId").
                IsRequired();
            ToTable("Follows");
        }
    }
}